package kku.cs.hero;

import org.newdawn.slick.Input;

import kku.cs.fgl.SpriteManager;

public class PlayerActor extends CharacterActor {

	public PlayerActor(SpriteManager sprites, String name) {
		super(sprites, name);	
		speed=1;
	}

	@Override
	public void update(int time) {
		super.update(time);
		if (input.isKeyDown(Input.KEY_LEFT)) moveLeft();
		if (input.isKeyDown(Input.KEY_RIGHT))moveRight();
		if (input.isKeyDown(Input.KEY_UP))   moveUp();
		if (input.isKeyDown(Input.KEY_DOWN)) moveDown();
		if (input.isKeyDown(Input.KEY_SPACE)) stop();
		scene.getDefView().focus(this);		
	}
}
